This is Your First R Markdown!

You can now create interactive visualizations.



Part 1: GGplot



Part 2: Interactive Plots



Part 3: Show Code Output


week_births<-birth_data %>% 
  group_by(week) %>% 
  summarize(births=sum(births, na.rm=T)) %>% 
  filter(week>=as.Date('2000-01-01') & 
           week<as.Date('2014-12-28'))

# Getting started with Plotly ----

plot_ly(week_births, x = ~week, 
        text = ~paste("Week Date: ", week, 
                      '\nBirths:', births)) %>% 
  add_trace(y = ~births, 
            name = 'Total Births', 
            mode = 'lines') %>% 
  layout(
    title = "Total Births by Week, 2000 - 2014",
    xaxis = list(
      title = "Week"
      ), 
    yaxis = list(
      title = "Total Births"
      ) 
  )

Part 4: In Line Code


You can also just write text like this when you want. You can also format in any number of ways.

Let’s start by looking at bulleted lists:

  • This is a single bullet
    • This is a single sub-bullet
  • we can also add inline code, for instance average daily births over time was 11350.0682606